import http2 from "@/api/http2";
/**获取工单列表 */
export const getWorkSheetList = data => {
  return http2.get(
    `/v1/workSheet/get_list?page=${data.page}&count=${data.count}&user_id=${data.user_id}`
  );
};
/**获取工单详情 */
export const getWorkSheetDetail = data => {
  return http2.get(`/v1/workSheet/select?sheet_id=${data}`);
};
/**回复工单 */
export const replyWorkSheet = data => {
  return http2.post("/v1/workSheet/reply", data, {
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};
/**删除工单 */
export const deleteWorkSheet = data => {
  return http2.post("/v1/workSheet/delete", data, {
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};
/**修改工单状态 */
export const editWorkSheet = data => {
  return http2.post("/v1/workSheet/retype", data, {
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};
/**创建工单 */
export const createWorkSheet = data => {
  return http2.post("/v1/workSheet/submit", data, {
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};
/**获取文件夹下面的文件列表 */
export const loadFIleList = data => {
  return http2.get(
    `/v1/file/list?container_id=${data.container_id}&path=${data.path}`
  );
};

/**获取文件内容 */
export const Fileinfo = data => {
  return http2.post("/v1/file/read", data, {
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};
/**创建文件 */
export const mkdir = data => {
  return http2.post("/v1/file/mkdir", data, {
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};
/**写入文件内容 */
export const write = data => {
  return http2.post("/v1/file/write", data, {
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};
/**删除文件 */
export const deleteFile = data => {
  return http2.post("/v1/file/delete", data, {
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};

// 上传文件
export const uploadFile = data => {
  return http2.post("/v1/file/upload_file", data, {
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};

// 压缩文件
export const Compressfile = data => {
  return http2.post("/v1/file/zip_file", data, {
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};

// 获取文件下载链接
export const getDwonLink = data => {
  return http2.post("/v1/file/get_down_link", data, {
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};

// 解压文件
export const UnZipFile = data => {
  return http2.post("/v1/file/unzip_file", data, {
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};
